<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>layui在线调试</title>
    <link rel="stylesheet" href="../../layui/css/layui.css" media="all">
    <style>
        body{background: white;width: 100%}
        .color{ color: #1E9FFF!important;font-weight: bold}
        .select input{height: 35px!important;width: 200px}
        thead td{background: #3c8dbc!important;color: white}
    </style>
</head>
<body>
<!--<span class="layui-breadcrumb" style="margin-left: 10px;margin-top: 6px;display: block">-->
<!--<span class="color">学籍信息&nbsp;-&nbsp;单一查询</span>-->
<!--</span>-->
<fieldset class="layui-elem-field site-demo-button" style="margin-top: 10px;width: 100%">
    <legend style="font-size: 14px"><span class="color">导出选课结果</span></legend>
    <table class="layui-table" lay-size="sm" style="width: 700px">
        <tr>
            <td>目前操作计划</td>
            <td>2017/2018学年第二学期网络选课</td>
            <td>
                <div class="selects">
                    <label>目前操作阶段：</label>
                    <select>
                        <option>--请选择--</option>
                        <option>第一阶段 </option>
                        <option>第二阶段</option>
                        <option>第三阶段</option>
                        <option>第四阶段</option>
                    </select>
                </div>
            </td>
            <td></td>
        </tr>
        <tr>
            <td>
                <div class="selects">
                    <label>查询方式：</label>
                    <select>
                        <option>--请选择--</option>
                        <option>行政班级 </option>
                        <option>开课系级</option>
                    </select>
                </div>
            </td>

            <td>
                <div class="selects">
                    <label>院系：</label>
                    <select>
                        <option>--请选择--</option>
                        <option>信息工程学院 </option>
                        <option>人文教育学院</option>
                        <option>人居环境学院</option>
                        <option>金融学院</option>
                    </select>
                </div>
            </td>


            <td  style="color: red">
                <div class="selects">
                    <label>年级：</label>
                    <select>
                        <option>--请选择--</option>
                        <option>1年级 </option>
                        <option>2年级 </option>
                        <option>3年级 </option>
                        <option>4年级 </option>
                    </select>
                </div>
            </td>
            <td>
                <div class="selects">
                    <label>班级：</label>
                    <select>
                        <option>--请选择--</option>
                        <option>统本英1401 </option>
                        <option>统本英1402 </option>
                    </select>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="4" style="text-align: center">
                <input type="button" value="导出选课结果">
            </td>
        </tr>
    </table>
</fieldset>
<script src="../../layui/layui.js"></script>
<script src="../../layui/jquery-1.12.4.min.js"></script>
<script>
    layui.use('element',"laydate", function(){
        var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
        var laydate = layui.laydate;

        //常规用法
        laydate.render({
            elem: '#test1'
        });
        //监听导航点击
        element.on('nav(demo)', function(elem){
            //console.log(elem)
            layer.msg(elem.text());
        });
    });
</script>
<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

        //创建一个编辑器
        var editIndex = layedit.build('LAY_demo_editor');

        //自定义验证规则
        form.verify({
            title: function(value){
                if(value.length < 5){
                    return '标题至少得5个字符啊';
                }
            }
            ,pass: [/(.+){6,12}$/, '密码必须6到12位']
            ,content: function(value){
                layedit.sync(editIndex);
            }
        });

        //监听指定开关
        form.on('switch(switchTest)', function(data){
            layer.msg('开关checked：'+ (this.checked ? 'true' : 'false'), {
                offset: '6px'
            });
            layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)
        });

        //监听提交
        form.on('submit(demo1)', function(data){
            layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            })
            return false;
        });


    });
</script>
</body>
</html>
